import kotlinx.coroutines.*

fun main(args: Array<String>) = runBlocking{
    println("Hello World!")

        InterceptorInvoker
            .next(Test1Iterator(object :Interceptor.CallBack{
                override fun onSuccess() {
                    println("Hello World!___1")
                }

                override fun onFail() {
                    println("Hello World!___2")
                }

            }))
            .next(Test1Iterator(object :Interceptor.CallBack{
                override fun onSuccess() {
                    println("Hello World!___1")
                }

                override fun onFail() {
                    println("Hello World!___2")
                }

            }))
            .invoke(object :InterceptorInvoker.CallBack{
                override fun onResult() {
                    if (InterceptorInvoker.mResult) {
                        //成功
                        println("Hello World!___3")
                    }else{
                        //失败
                        println("Hello World!___4")
                    }
                }

            })
    //等待协程执行完毕
        delay(10000)

}